package com.yuke.cloud.service.uac.service;

import com.yuke.cloud.common.base.dto.LoginAuthDto;
import com.yuke.cloud.service.uac.dto.AccMenuEnableDto;
import com.yuke.cloud.service.uac.entity.AccMenu;
import com.yuke.cloud.common.core.support.IService;
import com.yuke.cloud.service.uac.vo.MenuVo;

import java.util.List;


/**
 * Created by wg on 2018/10/31.
 */
public interface AccMenuService extends IService<AccMenu> {

    /**
     * 判断菜单是否有子菜单.
     *
     * @param menuId the menu id
     *
     * @return the boolean
     */
    boolean checkMenuHasChildMenu(Long menuId);

    /**
     * Delete acc menu by id int.
     *
     * @param id           the id
     *
     * @return the int
     */
    int deleteAccMenuById(Long id);

    List<AccMenu> getAllMenuListByUserId(Long userId, Long applicationId);
    List<MenuVo> getOwnMenuListByUserId(Long userId, Long applicationId);

    int saveAccMenu(AccMenu menu, LoginAuthDto loginAuthDto);

    AccMenu getViewMenuById(Long id);

    void updateUacMenuStatusById(AccMenuEnableDto accMenuEnableDto, LoginAuthDto loginAuthDto);
    int enableMenuList(List<AccMenu> menuList, LoginAuthDto loginAuthDto);
    int disableMenuList(List<AccMenu> menuList, LoginAuthDto loginAuthDto);
    List<AccMenu> getAllParentMenuByMenuId(Long menuId);
    List<AccMenu> getAllChildMenuByMenuId(Long menuId, Boolean menuIsEnable);

    /**
     * 根据角色ID查询菜单列表.
     *
     * @param roleId the role id
     *
     * @return the list
     */
    List<AccMenu> listMenuListByRoleId(Long roleId);
}
